let ws=new WebSocket('http://127.0.0.1:8080');
console.log(ws.readyState);
ws.onopen=()=>{
	console.log('Connection Success');
	console.log(ws.readyState);
}
ws.onmessage=function(event){
	let data=event.data;
	console.log(data);
	ws.send(data);
	console.log(ws.readyState);
}
ws.onerror=event=>{
	console.log(event);
	console.log(ws.readyState);
};
ws.onclose=event=>{
	console.log(event);
	console.log(ws.readyState);
}
ws.close();
